package com.weixin.paleituo.adapter;

import android.content.Context;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.weixin.paleituo.R;
import com.weixin.paleituo.base.ComAdapter;
import com.weixin.paleituo.bean.DepositBean;
import com.weixin.paleituo.help.ViewHolder;
import com.weixin.paleituo.util.UIUtils;

import java.util.List;

/**
 * Author yichao
 * Time  2018/1/12 9:27
 * Dest  订单预付金额
 */

public class OrderPayMoneyGridViewAdapter extends ComAdapter<DepositBean> {
    public void setSelectPosition(int selectPosition) {
        mSelectPosition = selectPosition;
    }

    private int mSelectPosition=0;

    public OrderPayMoneyGridViewAdapter(Context context, List<DepositBean> discountsBeanList) {
        super(context,discountsBeanList,R.layout.item_order_activity_layout);

    }
    @Override
    public void convert(ViewHolder holder, DepositBean item, int position) {
        LinearLayout  llroot = holder.getItemView(R.id.ll_root_item_order_activity_layout);
     TextView textView=   holder.getItemView(R.id.tv_paymoney_item_order_activity_layout);
        if (position==mSelectPosition){
            textView.setSelected(true);
            llroot.setSelected(true);
        }else {
            textView.setSelected(false);
            llroot.setSelected(false);

        }

        TextView tvPayMoney = holder.getItemView(R.id.tv_paymoney_item_order_activity_layout);
       // TextView  tvDiscounts = holder.getItemView(R.id.tv_discounts_item_order_activity_layout);

        tvPayMoney.setText(UIUtils.getMoney(item.getSum()));
      //  String discountStr = item.getDiscountStr();
    /*    if (!StringUtils.isEmpty(discountStr)){
            tvDiscounts.setVisibility(View.VISIBLE);
        tvDiscounts.setText(discountStr);

        }*/




    }

}
